﻿using SmartPlant.Model;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;

namespace SmartPlant.Services.Interfaces
{
    /// <summary>
    /// 任务作业服务
    /// </summary>
    public interface ITaskJobService
    {
        /// <summary>
        /// 查询TaskJob表里的记录
        /// </summary>
        /// <param name="proId"></param>
        /// <returns></returns>
        Task<TaskJob> GetJobAsync(string proId, string taskId);

        /// <summary>
        /// 查询TaskJob表里的记录
        /// </summary>
        /// <param name="proId"></param>
        /// <returns></returns>
        Task<List<TaskJob>> GetLisAsync(string proId);
        /// <summary>
        /// 关联文件下载
        /// </summary>
        /// <param name="proId"></param>
        /// <param name="taskJob"></param>
        /// <returns></returns>
        Task<RESTfulResult<Stream>> GetFileAsync(string proId, TaskJob taskJob);
        /// <summary>
        /// 文件下载
        /// </summary>
        /// <param name="proId"></param>
        /// <param name="task"><see cref="TaskJob"/>对象</param>
        /// <returns></returns>
        Task<RESTfulResult<FileContentResultBaseString>> DownloadFileAsync(string proId, string taskid);

        /// <summary>
        /// 删除任务
        /// </summary>
        /// <param name="proId"></param>
        /// <param name="taskid"></param>
        /// <returns></returns>
        Task<RESTfulResult<string>> DeleteTaskJobAsync(string proId, string taskid);
    }
}
